package jwr.basic;

public class J10_OOP {
	public static void main(String args[]){
		// OOP기본 - 클래스 작성
		// 클래스를 이용해서 객체를 생성 하려면 new 연산자, 생성자를 사용
		// 또한 생성된 객체를 변수화하려면 객체와 동일한 자료형으로 선언
		// 개체화 , stud, dept, sub, prof는 각각 인스턴스 변수임
		J10Student stud = new J10Student();
		J10Department dept = new J10Department();
		J10Subject sub = new J10Subject();
		J10Professor prof = new J10Professor();
		
		stud.hakbun = "201350050";
		stud.name = "김태희";
		stud.addr = "경기도고양시";
		stud.birth = "1985.3.22";
		stud.depart = "컴퓨터";
		stud.prof = "504";
		
		System.out.println(stud.hakbun);
		System.out.println(stud.name);
		System.out.println(stud.addr);
		System.out.println(stud.birth);
		System.out.println(stud.depart);
		System.out.println(stud.prof);
		System.out.println();
		dept.dapartName = "컴퓨터공학";
		dept.telNo = "123-4567-8901";
		dept.office = "E동 2층";
		dept.chief = "504";
		
		System.out.println(dept.dapartName);
		System.out.println(dept.telNo);
		System.out.println(dept.office);
		System.out.println(dept.chief);
		
		System.out.println();
		
		sub.subName = "프로그래밍";
		sub.subNum = "0205";
		sub.summary = "자바 프로그래밍";
		sub.prof = "301";
		
		System.out.println(sub.subName);
		System.out.println(sub.subNum);
		System.out.println(sub.summary);
		System.out.println(sub.prof);
		
		System.out.println();
		
		prof.profNum = "301";
		prof.profName = "이순신";
		prof.profMajor = "프로그래밍";
		
		System.out.println(prof.profNum);
		System.out.println(prof.profName);
		System.out.println(prof.profMajor);
	} // main
	
} // class

class J10Student{
	//필드, 멤버변수
	String hakbun, name, addr, birth,depart,prof;
	//생성자
	public J10Student() {
	}
}//Student class

class J10Department{
	String dapartName, telNo, office, chief;
	public J10Department() {
	}
}//Department class

class J10Subject{
	String subNum,subName, summary, prof;
	public J10Subject() {
	}
}//Subject class

class J10Professor{
	String profName, profMajor, profNum;
	public J10Professor() {
	}
}//Professor class

